function xnsslopeFn = nsslopeFn(x)
xnsslopeFn = ((5137*sin(x(1)))/50000 + sin(x(1) + x(2))/10 +  ...
  (-5137*sin(x(1)) - 5000*sin(x(1) + x(2)) +  ...
    5000*sin(x(1) + x(2) + x(3) - x(4)) +  ...
    5137*sin(x(1) + x(2) + x(3) - x(4) - x(5)))/50000)/ ...
 ((-5137*cos(x(1)))/50000 - cos(x(1) + x(2))/10 +  ...
  (5137*cos(x(1)) + 5000*cos(x(1) + x(2)) -  ...
    5000*cos(x(1) + x(2) + x(3) - x(4)) -  ...
    5137*cos(x(1) + x(2) + x(3) - x(4) - x(5)))/50000) ...
;